package cmm;



import java.net.InetAddress;
import java.net.UnknownHostException;

public class ConnectionInformation implements IConnectionInformation {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4510988436227875205L;

	private InetAddress IP;
	
	private short Port;
	
//---------------------------------------------------------------------	

	public ConnectionInformation clone() {
		ConnectionInformation NewConn = new ConnectionInformation();
		try {
			NewConn.IP = InetAddress.getByName(IP.getHostAddress());
		} catch (UnknownHostException e) {
			// will never happen
			e.printStackTrace();
		}
		NewConn.Port = Port;
		return NewConn;
	}
	
	public InetAddress getIP() {
		return IP;
	}

	public short getPort() {
		return Port;
	}

	public void putIP(InetAddress IP) {
		this.IP = IP;
	}

	public void putPort(short port) {
		this.Port = port;
	}

}
